// Copyright (C) joyinter
// All rights reserved.
// 
// Author : Lu Rong
// Date   : 2005-03-15

#ifndef __TRENCHINFO_H_CLIENT_MAIN__
#define __TRENCHINFO_H_CLIENT_MAIN__

#pragma once

#include <common\ui\wnd.h>
#include <common\ui\label.h>

class CJoyCSPlayerItem;
class CJoyTrench;

namespace JoyTrenchElem
{

//##ModelId=44C4B5DA036B
class CJoyTrenchInfo : public CJoyWnd
{
	DECLARE_DYNAMIC(CJoyTrenchInfo)

protected:
	friend class CJoyTrench;
	friend class CJoyCSPlayerItem;

	//##ModelId=44C4B5DA037B
	CJoyTrench	*m_trench;

	//##ModelId=44C4B5DA037F
	int		m_cornerSize;
	//##ModelId=44C4B5DA0381
	Color	m_frameColor;
	//##ModelId=44C4B5DA038B
	Color	m_cornerColor;
	//##ModelId=44C4B5DA0390
	Color	m_borderColor;
	//##ModelId=44C4B5DA039A
	Color	m_titleColor;
	//##ModelId=44C4B5DA039F
	Color	m_iconColor;
	//##ModelId=44C4B5DA03AA
	Color	m_backColor2;
	//##ModelId=44C4B5DA03AF
	Color	m_itemTitleTxtColor;
	//##ModelId=44C4B5DA03B3
	CString	m_itemTitleTxtFace;
	//##ModelId=44C4B5DA03B9
	int		m_titleHeight;
	//##ModelId=44C4B5DA03BA
	int		m_gameTitleWd;
	//##ModelId=44C4B5DA03C8
	int		m_gameTitleStart;
	//##ModelId=44C4B5DA03C9
	int		m_itemHeight;
	//##ModelId=44C4B5DA03D8
	int		m_playerSlit;
	//##ModelId=44C4B5DA03D9
	CString	m_gameTitle;
	//##ModelId=44C4B5DB0000
	CString m_PlayerTitle;

	// game data
	//##ModelId=44C4B5DB0001
	CString		m_gameName;
	//##ModelId=44C4B5DB000F
	CString		m_mapName;	
	//##ModelId=44C4B5DB0010
	UINT		m_maxPlayerCount;
	//##ModelId=44C4B5DB001F
	UINT		m_playingCount;
	//##ModelId=44C4B5DB0020
	UINT		m_spectatorCount;
	
	// player data
	//##ModelId=44C4B5DB002E
	UINT		m_playerId;
	//##ModelId=44C4B5DB002F
	CString		m_nickName;
	//##ModelId=44C4B5DB003E
	CString		m_playName;
	//##ModelId=44C4B5DB003F
	UINT		m_playerLevel;
	//##ModelId=44C4B5DB004E
	UINT		m_playerLadder;
	//##ModelId=44C4B5DB004F
	UINT		m_killCount;
	//##ModelId=44C4B5DB005D
	UINT		m_bekillCount;
	//##ModelId=44C4B5DB005E
	LONG		m_playTime;
	//##ModelId=44C4B5DB006D
	CString		m_battleGroup;

	// interface
	//##ModelId=44C4B5DB006F
	CJoyLabel	*m_gameNameLbl;
	//##ModelId=44C4B5DB007E
	CJoyLabel	*m_mapNameLbl;
	//##ModelId=44C4B5DB0083
	CJoyLabel	*m_playerCountLbl;
	//##ModelId=44C4B5DB008D
	CJoyLabel	*m_spectatorCountLbl;

	//##ModelId=44C4B5DB0092
	CJoyLabel	*m_nickNameLbl;
	//##ModelId=44C4B5DB009D
	CJoyLabel	*m_playNameLbl;
	//##ModelId=44C4B5DB00A2
	CJoyLabel	*m_playerLevelLbl;
	//##ModelId=44C4B5DB00AC
	CJoyLabel	*m_playerLadderLbl;
	//##ModelId=44C4B5DB00B1
	CJoyLabel	*m_killCountLbl;
	//##ModelId=44C4B5DB00BC
	CJoyLabel	*m_bekillCountLbl;
	//##ModelId=44C4B5DB00C1
	CJoyLabel	*m_playTimeLbl;
	//##ModelId=44C4B5DB00CC
	CJoyLabel	*m_battleGroupLbl;

	//##ModelId=44C4B5DB00DA
	virtual void CM_LoadSkin(CJoyXmlElement* pSkinElem);
	//##ModelId=44C4B5DB00DD
	virtual void CM_Draw(Graphics& graph);

	//##ModelId=44C4B5DB00EB
	virtual void CM_SetPlayerItem();
	//##ModelId=44C4B5DB00ED
	virtual void CM_SetGameInfo();

	//##ModelId=44C4B5DB00FB
	void DrawText(Graphics &graph, const CStringW &text, Brush& txBrush, Font& f, StringFormat& sf, const Rect &rect);

public:
	//##ModelId=44C4B5DB0128
	CJoyTrenchInfo();
	//##ModelId=44C4B5DB0129
	virtual ~CJoyTrenchInfo();

	//##ModelId=44C4B5DB012B
	void SetPlayerItem(CJoyCSPlayerItem *pPlayerItem);
	//##ModelId=44C4B5DB0138
	void SetPlayerEmpty();
	//##ModelId=44C4B5DB0139
	void SetGameInfo();

public:
	DECLARE_MESSAGE_MAP()
	//##ModelId=44C4B5DB013A
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
};

}; // namespace JoyTrenchElem

#endif // __TRENCHINFO_H_CLIENT_MAIN__
